package com.whale.kernel.domain;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.springframework.format.annotation.DateTimeFormat;

public class HtmlPage {

	private Long id;
	@NotNull
	private String pageId;
	@NotNull
	private String title;
	@NotNull
	private String pageLocation;
	private String iconLocation;
	@Size(max = 2000)
	private String shortDescription;
	@NotNull
	private HtmlMenu menu;
	
	@DateTimeFormat(style = "S-")
	private Date modificationDate = new Date();
	
	private transient String pagePath; // not persistent

	public HtmlPage() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getPageId() {
		return pageId;
	}

	public void setPageId(String pageId) {
		this.pageId = pageId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	public String getPageLocation() {
		return pageLocation;
	}

	public void setPageLocation(String pageLocation) {
		this.pageLocation = pageLocation;
	}

	public String getIconLocation() {
		return iconLocation;
	}

	public void setIconLocation(String iconLocation) {
		this.iconLocation = iconLocation;
	}

	public HtmlMenu getMenu() {
		return menu;
	}

	public void setMenu(HtmlMenu menu) {
		this.menu = menu;
	}
	
	public String getPagePath() {
		return pagePath;
	}

	public void setPagePath(String pagePath) {
		this.pagePath = pagePath;
	}
	
	public void setModificationDate(Date modificationDate) {
		this.modificationDate = modificationDate;
	}

	public Date getModificationDate() {
		return modificationDate;
	}

	@Override
	public String toString() {
		return "HtmlPage [pageId=" + pageId + ", title=" + title
				+ ", pageLocation=" + pageLocation + ", iconLocation="
				+ iconLocation + ", shortDescription=" + shortDescription
				+ ", menu=" + menu + "]";
	}

}
